<template>
	<view>
		<view class="pagess">
			<uNavbar title="车辆详情" bgColor="transparent" leftIconColor="#ffffff" :titleStyle="titleStyle"></uNavbar>
			<view class="carinfo flex_ZC">
				<rich-text class="tips_centet" :nodes="this.carInfo.vehicle_introduction"></rich-text>
				<view class="btn_gw flex_c" @click="goWebsite">
					<text>去车型官网查看详情</text>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import {
		carIndexInfo,
	} from "../../api/mycar.js";
	export default {
		data() {
			return {
				carInfo: {},
				nodeCentent: '',
				titleStyle: {
					color: '#ffffff'
				},
			}
		},
		onLoad() {
			this.initInfo()
		},
		methods: {
			// 首页数据
			initInfo() {
				carIndexInfo().then(res => {
					console.log(res);
					if (res.code == 1) {
						this.carInfo = res.data.member_carpool
						this.nodeCentent = res.data.member_carpool.vehicle_introduction.replace(/\r\n/g, "<p/>") ||
							'';
					}
				})
			},
			goWebsite() {
				// #ifdef H5
				window.location.href = this.carInfo.official_website
				// #endif
				
				// #ifdef APP
					plus.runtime.openURL(this.carInfo.official_website)
				// #endif
			}
		},
	}
</script>

<style scoped>
	.pagess {
		width: 100%;
		min-height: 100vh;
		background: #10191F;
	}

	.carinfo {
		position: relative;
		width: 690rpx;
		min-height: 1280rpx;
		box-shadow: inset 0rpx 0rpx 20rpx 0rpx #1C85DB;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 50rpx auto;

	}

	.tips_centet {
		padding: 20rpx 30rpx;
		font-size: 28rpx;
		color: #dbdbdb;
	}

	.btn_gw {
		position: absolute;
		bottom: 40rpx;
		left: 50%;
		transform: translateX(-50%);
		width: 600rpx;
		height: 80rpx;
		box-shadow: inset 0rpx 0rpx 20rpx 0rpx #1C85DB;
		font-size: 32rpx;
		color: #ffffff;
	}
</style>